#pragma once
#include "../LMCommon.h"
#include <boost/smart_ptr.hpp>
#include <boost/thread.hpp>

class LMMaster;
class LMContext;
class LMWorker
{
public:
	LMWorker(boost::shared_ptr<LMContext> context, boost::shared_ptr<LMMaster> master, int index);
	virtual ~LMWorker();

	void start();

protected:
	void worker_thread();

protected:
	boost::shared_ptr<LMMaster> _master;
	int _index;
	boost::scoped_ptr<boost::thread> _worker_thr;
	boost::shared_ptr<LMContext> _context; 
};
